package _thread_lock._futurepattern._future;

import java.util.concurrent.TimeUnit;

/**
 * @Author: huangya
 * @Date: 2020/10/19
 * @Description:
 */
public class Test00000 {

    public static void main(String[] args) throws InterruptedException {
        FutureService<Void, Void> service = FutureService.newService();
        Future<?> future = service.submit(() -> {
            try {
                TimeUnit.SECONDS.sleep(3);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("I am finish done.");
        });
        future.get();
    }
}
